import Vue from 'vue'
import VueRouter from 'vue-router'

const ShopDashBoard = () => import('src/components/shop/pages/Dashboard');
const MainPage = () => import('src/components/shop/layout/MainPage');
const Lack = () => import('src/components/shop/pages/Lack');
const Center = () => import('src/components/shop/pages/Center');
const Deliver = () => import( 'src/components/shop/pages/Deliver');
const Order = () => import( 'src/components/shop/pages/Order');
const Register = () => import( 'src/components/shop/pages/Register');
const Login = () => import( 'src/components/shop/pages/Login');
const Bind = () => import( 'src/components/shop/pages/Bind');
const Page404 = () => import( 'src/components/shop/pages/Page404');
const Rename = () => import( 'src/components/shop/pages/Rename');

Vue.use(VueRouter);

export default new VueRouter({
  mode: 'history',
  routes: [
    {
      path: '/shop/index.html',
      name: '首页',
      component: MainPage,
      redirect: '/shop/dashboard.html',
      children: [
        {
          path: '/shop/dashboard.html',
          name: 'Dashboard',
          component: ShopDashBoard
        },
        {
          path: '/shop/lack.html',
          name: '缺货列表',
          component: Lack
        },
        {
          path: '/shop/order.html',
          name: '自购列表',
          component: Order
        },
        {
          path: '/shop/deliver.html',
          name: '领货列表',
          component: Deliver
        },

        {
          path: '/shop/rename.html',
          name: '更名列表',
          component: Rename
        },
        {
          path: '/shop/center.html',
          name: '用户中心',
          component: Center
        }
      ]
    },
    {
      path: '/shop/login.html',
      name: '用户登录',
      component: Login,
    },

    {
      path: '/shop/register.html',
      name: '用户注册',
      component: Register,
    },

    {
      path: '/shop/bind.html',
      name: '用户绑定',
      component: Bind,
    },
    {
      path: '*',
      name: '未找到页面',
      component: Page404,
    }
  ]
})
